Learn R Programming

simex (version 1.0)

simex: Simulation Extrapolation

Description

Implementation of the SIMEX Algorithm for measurement error models according to Cook and Stefanski

Usage

simex(model
	, SIMEXvariable
	, measurement.error
	, lambda = c(0.5,1,1.5,2)
	, B = 100, fitting.method = "quadratic"
	, jackknife.estimation = "quad"
	, asymptotic = TRUE)

Arguments

model
the naive model
SIMEXvariable
character or vector of characters containing the names of the variables with measurement error
measurement.error
vector of standard deviations of the known measurement errors
lambda
vector of lambdas for which the simulation step should be done (without 0)
B
number of iterations for each lambda
fitting.method
fitting method linear,quadratic,nonlinear are implemented. (first 4 letters are enough)
jackknife.estimation
specifying the extrapolation method for jackknife variance estimation. Can be set to FALSE if it should not be performed
asymptotic
logical, indicating if asymptotic variance estimation should be done, in the Naive model the option x = TRUE have to be set.

Value

  • Returns an object of class SIMEX which contains:
  • coefficientsthe corrected coefficients of the SIMEX model,
  • SIMEX.estimatesthe estimates for every lambda,
  • modelthe naive model,
  • measurement.errorthe known error variances,
  • Bthe number of iterations,
  • extrapolationthe model object of the extrapolation step,
  • fitting.methodthe fitting method of the extrapolation step,
  • residualsresiduals,
  • fitted.valuesfitted values,
  • callthe function call,
  • variance.jackknifethe jackknife variance estimate,
  • extrapolation.variancethe model object of the variance extrapolation,
  • variance.jackknife.lambdathe data set for the extrapolation
  • variance.asymptoticthe asymptotic variance estimates
  • thetaestimates for every B and lambda
  • ...

Details

nonlinear is implemented as described in Cook and Stefanski, but is numerically not stable. It is not advisable to use this feature. See fit.nls for details. If a nonlinear extrapolation is desired please use the refit function. Asymptotic is only implemented for naive models of class lm or glm

References

Cook, J.R. and Stefanski, L.A. (1994) Simulation-Extrapolation Estimation in Parametric Measurement error Models. Journal of American Statistical Assosiaction, 89, 1314 -- 1328 Carroll, R.J., K�chenhoff,H., Lombard,F. and Stefanski L.A. (1996) Asymptotics for the SIMEX Estimator in Nonlinear Measurement Error Models. Journal of the American Statistical Association, 91, 242 -- 250 Carrol, R.J., Ruppert, D. and Stefanski L.A. (1995). Measurement Error in Nonlinear Models. London: Chapman and Hall.

See Also

mcsimex for discreete data with misclassification, lm,glm, refit

Examples

Run this code
# to test nonlinear extrapolation set.seed(3)
x <- rnorm(200,0,100)
u <- rnorm(200,0,25)
w <- x+u
y <- x +rnorm(200,0,9)
true.model <- lm(y~x) # True model
naive.model <- lm(y~w, x=TRUE)
simex.model <- simex(model = naive.model
	, SIMEXvariable = "w"
	, measurement.error= 25)
plot(x,y)
abline(true.model,col="darkblue")
abline(simex.model,col ="red")
abline(naive.model,col = "green")
legend(min(x),max(y),legend=c("True Model","SIMEX model","Naive Model")
	, col = c("darkblue","red","green"),lty=1)

plot(simex.model, mfrow = c(2,2))

Run the code above in your browser using DataLab